# 购物车
# author: liml
# 2021-07-04
class ShoppingCart(object):
    pass


m = ShoppingCart()
m1 = ShoppingCart()
m3 = ShoppingCart()


# 汽车
# author: liml
# 2021-07-04
class Vehicle(object):
    def __init__(self, n):
        self.name = n


class AutomobileSalesServiceShop4S(object):
    def __init__(self, n):
        self.name = n


class Person(object):
    def __init__(self, n):
        self.name = n

    def shopping(self, addr, something):
        print(self.name, "在", addr.name, "购买了一台", something.name)


class Cloud(object):
    # __init__ 方法是初始化实例属性的,self指代当前实例
    def __init__(self, add):
        self.address = add

    def move(self, direction):
        print(self.address,"的一朵乌云", "朝着", direction, "移动")


# 实例，一个实际的例子
c1 = Cloud("台北明珠小区上空")
c1.color = "grey"
print(c1.color)
print(c1.address)
c1.move("西")
c2 = Cloud("绿地城小区上空")
print(c2.address)

# 小明去4S店购买了一辆特斯拉汽车
xiMing = Person("小明")
xiMing.height = 150
qiChen = AutomobileSalesServiceShop4S("启晨")
tesla = Vehicle("Model 3")
xiMing.shopping(qiChen, tesla)
# Joker在汽车店购买了一辆越野车
p1 = Person("Joker")
p1.age = 30
s4 = qiChen = AutomobileSalesServiceShop4S("华阳")
v1 = Vehicle("HanMa")
p1.shopping(s4, v1)

